/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

// change all the data to javax.sql.date;
// change all the created by
/**
 *
 * @author cheeseng
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class SalesLead implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long leadId;
    private String salutation;
    private String contactPerson;
    private String company;
    @OneToOne(cascade = {CascadeType.PERSIST})
    private Address companyAddress;
    @OneToMany(cascade = {CascadeType.PERSIST}, mappedBy = "SaleLead")
    private List<SalesInquiry> saleInquiry = new ArrayList();
    private String phone;
    private String email;
    private String description;

    public SalesLead() {
    }

    public void create(String salutation, String contactPerson, String company, String phone, String email, String description) {
        this.salutation = salutation;
        this.contactPerson = contactPerson;
        this.company = company;
        this.phone = phone;
        this.email = email;
        this.description = description;


    }

    public List<SalesInquiry> getSaleInquiry() {
        return saleInquiry;
    }

    public void setSaleInquiry(List<SalesInquiry> saleInquiry) {
        this.saleInquiry = saleInquiry;
    }

    public String getSalutation() {
        return salutation;
    }

    public void setSalutation(String salutation) {
        this.salutation = salutation;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public Address getCompanyAddress() {
        return companyAddress;
    }

    public void setCompanyAddress(Address companyAddress) {
        this.companyAddress = companyAddress;
    }

    public String getContactPerson() {
        return contactPerson;
    }

    public void setContactPerson(String contactPerson) {
        this.contactPerson = contactPerson;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public long getLeadId() {
        return leadId;
    }

    public void setLeadId(long leadId) {
        this.leadId = leadId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
